class Point {
    constructor(x, y) {
	this.x = x;
	this.y = y;
    }

    toString() {
	return `( ${this.x} , ${this.y} )`;
    }
}

let point = new Point(2,3);
console.log(point.toString());

point.hasOwnProperty('x');
point.hasOwnProperty('toString');
point.__proto__.hasOwnProperty('toString');


class ColorPoint extends Point {
    constructor(x,y,color) { super(x,y); this.color = color; }
    toString() { return `${this.color} , ${super.toString()}`; }
}

let c = new ColorPoint(1,4,'x');
console.log(c.toString());
